$("#joinTime").datepicker({
    format: 'yyyy-mm-dd'
});

$$scope.belongCompanyCodeSelect = [
    {name:"赛特斯广东",code:"STSGD"},
    {name:"赛特斯南京",code:"STSNJ"},
    {name:"赛特斯北京",code:"STSBJ"},
    {name:"赛特斯上海",code:"STSSH"},
    {name: "融合运维事业部", code: "SYB-RX"},
    {name:"浩方科技",code:"HFKJ"},
    {name:"浩方信息",code:"HFXX"}
]

$$scope.getBelongCompanyName = function(companyCode){
    if(companyCode == "STSJT"){
        return "赛特斯集团";
    }else if(companyCode == "STSGD"){
        return "赛特斯广东";
    }else if(companyCode == "HFKJ"){
        return "浩方科技";
    }else if(companyCode == "HFXX"){
        return "浩方信息";
    }else if(companyCode == "STSBJ"){
        return "赛特斯北京";
    }else if(companyCode == "STSNJ"){
        return "赛特斯南京";
    }else if(companyCode == "STSSH"){
        return "赛特斯上海";
    }
}

$CertusJsonAjax.ajax("queryYGRZProcessTrace",{
    "processInstanceId": $CertusJsonAjax.getProInstanceId(),
    "stepInstanceId": $CertusJsonAjax.getStepInstanceId()
},function(res){
    $$scope.processCCBXTrace = res.data;
})
//查询 基本 数据
$CertusJsonAjax.ajax("baseUserByProcessId",{
    "processInstanceId": $CertusJsonAjax.getProInstanceId(),
    "stepInstanceId": $CertusJsonAjax.getStepInstanceId()
},function(res){

    if(res.data){
        $$scope.rzlcStepEntity = res.data;

        $$scope.rzlcStepEntity.baseUser.departmentUser.companyName = $$scope.getBelongCompanyName($$scope.rzlcStepEntity.baseUser.belongCompanyCode);

        $$scope.rzlcStepEntity.processInstanceId = $CertusJsonAjax.getProInstanceId();
        $$scope.rzlcStepEntity.stepInstanceId = $CertusJsonAjax.getStepInstanceId();

        $$scope.companySelect = [
            {name:"赛特斯集团",code:"STSJT"},
            {name:"赛特斯广东",code:"STSGD"},
            {name:"赛特斯南京",code:"STSNJ"},
            {name:"赛特斯北京",code:"STSBJ"},
            {name:"赛特斯上海",code:"STSSH"},
            {name:"融合运维事业部",code:"SYB-RX"},
            {name:"浩方科技",code:"HFKJ"},
            {name:"浩方信息",code:"HFXX"}
        ]

        for(var cs in $$scope.companySelect){
            if($$scope.companySelect[cs].code == $$scope.rzlcStepEntity.baseUser.belongCompanyCode){
                $$scope.rzlcStepEntity.baseUser.departmentUser.companyName = $$scope.companySelect[cs].name;
            }
        }
    }
})

$$scope.getSex = function(a){
    if(a == 1){
        return "男";
    }else{
        return "女";
    }
}

$$scope.getMarriage = function(a){
    if(a == 1){
        return "已婚";
    }else if(a == 0 ){
        return "未婚";
    }else if(a == 2){
        return "已婚已育";
    }

    return "未婚";
}


$$scope.emailSubmit = function(){
    // $$scope.rzlcStepEntity.baseUser.email = $$scope.rzlcStepEntity.baseUser.email + "@Certusnet.com.cn";
    if(certusValidateNotnull()){
        $CertusJsonAjax.ajax("emailSubmit",$$scope.rzlcStepEntity,function(res){
            if(res.data == "success"){
                findBacklogPerson($CertusFormAjax,$CertusJsonAjax.getStepInstanceId());
                history.back();
                return;
            }
            layer.msg("数据错误");
        })
    }
}


